package java_variables;

public class VariableScope {

	static int f = 0; // field scope is throughout the class
	
	public static void main(String[] args) {
		new VariableScope().printVariables(100);
	}
	
	void printVariables(int m)	{ //Parameter scope is throughout the method
		int i = 10; // Scope is from Declaration to end of method
		i++;
		
		int j = 20; // Scope is from Declaration to end of method
		j++;
		
		m++;
		
		f++; // field
		
		printField();
		System.out.println("m = " + m);
		System.out.println("i = " + i);
		System.out.println("j = " + j);
	}
	
	void printField(){
		// Scope of field is across multiple methods of a Class
		System.out.println("f = " + f);
	}
}
